package cn.tedu.service;/**
 * @Author 金帮嘉诚 @Date 2021-07-20 星期二 9:41
 */
/*本类用于测试*/

import cn.tedu.mapper.DeptMapper;
import cn.tedu.pojo.Dept;
import cn.tedu.utils.MybatisUtil;
import org.apache.ibatis.session.SqlSession;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

/**
 * 知识点
 * 泛型参数指定 在接口名称后的尖括号内
 */
@Service
public class DeptServiceImpl implements DeptService {
    private DeptMapper deptMapper = getMapper();

    @Override
    public DeptMapper getMapper() {
        SqlSession session = MybatisUtil.getSession();
        deptMapper = session.getMapper(DeptMapper.class);
        return deptMapper;
    }

    @Override
    public List<Dept> getByColumns(Dept dept) {
        return deptMapper.getByColumns(dept);
    }

    @Override
    public List<Dept> getAll() {
        return deptMapper.getAll();
    }

    @Override
    public List<Dept> getBySeveralId(String[] ids) {
        return deptMapper.getBySeveralId(ids);
    }

}
